package com.wc.alorithm_blue_bridge._枚举.打花结;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2025/2/14 13:41
 * @description
 * https://www.lanqiao.cn/problems/20178/learning/?contest_id=233
 */
public class Main {
    /**
     * 思路：
     * 枚举每一个可能的面积
     * 将h, w的每一个可能都列举出来就可以了
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 10;
    static int n, h, w, x;
    static int[] hs = new int[N], ws = new int[N];

    public static void main(String[] args) {
        int T = sc.nextInt();
        x = sc.nextInt();
        while (T-- > 0) {
            h = sc.nextInt();
            w = sc.nextInt();
            int n = 0, m = 0;
            while (h > 0) {
                hs[n++] = h;
                if ((h & 1) != 0) break;
                h /= 2;
            }
            while (w > 0) {
                ws[m++] = w;
                if ((w & 1) != 0) break;
                w /= 2;
            }
            boolean exist = false;
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    int h = hs[i], w = ws[j];
                    if (h * w == x) {
                        exist = true;
                        break;
                    }
                }
            }
            if (exist) out.println("Yes");
            else out.println("No");
        }
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

